HTML 77.2%
TypeScript 10.5%
Python 9.6%
JavaScript 2.5%
1import { SITEMAP_HEADERS, shardEntries, toUrlset } from '@/components/meta/sitemap-data';23/** Sitemap shards: /sitemap/static.xml, /sitemap/model-0.xml … (5 000 URLs per shard, from GET /sitemap?type=&offset=). */4export const revalidate = 3600;56export async function GET(_req: Request, ctx: { params: Promise<{ shard: string }> }): Promise<Response> {7 const { shard } = await ctx.params;8 const m = /^([a-z_]+(?:-\d+)?)\.xml$/.exec(shard);9 if (!m) return new Response('Not Found', { status: 404 });10 const entries = await shardEntries(m[1] as string);11 if (entries === null) return new Response('Not Found', { status: 404 });12 return new Response(toUrlset(entries), { headers: SITEMAP_HEADERS });13}14